package org.tc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.tc.bean.ItemCat;
import org.tc.service.ItemCatService;

import java.util.List;

/**
 * Created by zxd on 2018/1/25.
 */
@RequestMapping("/cat")
@Controller
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;


    @RequestMapping("/list")
    @ResponseBody
    public List<ItemCat> queryItemCat(@RequestParam(value = "id",defaultValue = "0") Long parentId){
        return itemCatService.queryItemCat(parentId);
    }


}
